{% extends 'layout.html' %}
{% load static %}
{% block active-register %}{% endblock %}
{% block body %}
  <main>
    <div class="container">

      <section class="section register min-vh-100 d-flex flex-column align-items-center justify-content-center py-4">
        <div class="container">
          <div class="row justify-content-center">
            <div class="col-lg-4 col-md-6 d-flex flex-column align-items-center justify-content-center">
              <div class="d-flex justify-content-center py-4">
                <a href="index.html" class="logo d-flex align-items-center w-auto">
                  <img src="assets/img/logo.png" alt="">
                  <span class="d-none d-lg-block">NiceAdmin</span>
                </a>
              </div><!-- End Logo -->
              <div class="card mb-3">
                <div class="card-body">
                  <div class="pt-4 pb-2">
                    <h5 class="card-title text-center pb-0 fs-4">创建账户</h5>
                    <p class="text-center small">输入您的个人信息以创建账户</p>
                  </div>

                  <form class="row g-3 needs-validation" novalidate method="post">
                    <div class="col-6">
                      <label for="{{ form.first_name.id_for_label }}" class="form-label">姓</label>
                      {{ form.first_name.as_p }}
                      <input type="text" name="{{ form.first_name.name }}" class="form-control" id="{{ form.first_name.id_for_label }}" required>
                    </div>
                    <div class="col-6">
                      <label for="{{ form.last_name.id_for_label }}" class="form-label">名</label>
                      {{ form.last_name.as_p }}
                      <input type="text" name="{{ form.last_name.name }}" class="form-control" id="{{ form.last_name.id_for_label }}" required>
                    </div>
                    <div class="col-12">
                      <label for="{{ form.email.id_for_label }}" class="form-label">邮箱</label>
                      {{ form.email.as_p }}
                      <input type="email" name="{{ form.email.name }}" class="form-control" id="{{ form.email.id_for_label }}" required>
                      <div class="invalid-feedback">您的邮箱地址</div>
                    </div>
                    <div class="col-12">
                      <label for="{{ form.username.id_for_label }}" class="form-label">用户名</label>
                      <div class="input-group has-validation">
                        <span class="input-group-text">@</span>
                        {{ form.username.as_p }}
                        <input type="text" id="{{ form.username.id_for_label }}" class="form-control" name="{{ form.username.name }}" value="{{ form.username.value|default_if_none:'' }}" required>
                      </div>
                    </div>
                    <div class="col-12">
                      <label for="{{ form.password.id_for_label }}" class="form-label">密码</label>
                      <div class="input-group has-validation">
                        {{ form.password.as_p }}
                        <input type="password" id="{{ form.password.id_for_label }}" class="form-control" name="{{ form.password.name }}" value="{{ form.password.value|default_if_none:'' }}" required>
                      </div>
                    </div>
                    <div class="col-12">
                      <div class="form-check">
                        <input class="form-check-input" name="terms" type="checkbox" value="" id="acceptTerms" required>
                        <label class="form-check-label" for="acceptTerms">我同意 <a href="#">隐私与运营策略</a></label>
                        <div class="invalid-feedback">您应当先同意我们的策略.</div>
                      </div>
                    </div>
                    <div class="col-12">
                      <button class="btn btn-primary w-100" type="submit">创建</button>
                    </div>

                  </form>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>

    </div>
  </main><!-- End #main -->

{% endblock %}